package androidx.test.espresso;

import android.view.View;
import androidx.test.espresso.base.RootViewPicker;
import androidx.test.espresso.base.ViewFinderImpl;
import androidx.test.espresso.core.internal.deps.guava.base.Preconditions;
import androidx.test.espresso.matcher.RootMatchers;
import androidx.test.espresso.remote.RemoteInteraction;
import androidx.test.espresso.remote.RemoteInteractionRegistry;
import java.util.concurrent.atomic.AtomicReference;
import org.hamcrest.Matcher;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public class ViewInteractionModule {
    private final Matcher<View> viewMatcher;
    private final AtomicReference<Matcher<Root>> rootMatcher = new AtomicReference<>(RootMatchers.DEFAULT);
    private final AtomicReference<Boolean> needsActivity = new AtomicReference<>(true);

    /* JADX INFO: Access modifiers changed from: package-private */
    public ViewFinder provideViewFinder(ViewFinderImpl impl) {
        return impl;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public ViewInteractionModule(Matcher<View> viewMatcher) {
        this.viewMatcher = (Matcher) Preconditions.checkNotNull(viewMatcher);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public RemoteInteraction provideRemoteInteraction() {
        return RemoteInteractionRegistry.getInstance();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public AtomicReference<Boolean> provideNeedsActivity() {
        return this.needsActivity;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public AtomicReference<Matcher<Root>> provideRootMatcher() {
        return this.rootMatcher;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public Matcher<View> provideViewMatcher() {
        return this.viewMatcher;
    }

    public View provideRootView(RootViewPicker rootViewPicker) {
        return rootViewPicker.get();
    }
}
